package com.n9.qq.client;

import java.io.Closeable;

/**
 * 模拟客户端
 * @author ice
 * @since 2019/1/31 15:31
 */
public interface MockClient extends Closeable {
    /**
     * 发送消息，不等待服务器回复
     * @param toServiceMsg
     */
    void send(ToServiceMsg toServiceMsg);

    /**
     * 发送消息,等待服务器回复消息
     * @param toServiceMsg
     * @param timeout       超时时间
     * @return
     */
    <T extends FromServiceMsg> T send(ToServiceMsg toServiceMsg, long timeout);


    /**
     * 处理服务端发送过来的消息
     * @param fromServiceMsg
     */
    void handle(FromServiceMsg fromServiceMsg);
}
